import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class cGame extends Canvas implements Runnable {
    boolean running = false;

    public cGame() {
        running = true;
        setFullScreenMode(true);
    }

    public void start() {
        
    }

    public void run() {
        System.out.println("run()");
        load();
        while(running) {
            System.out.println("running");
            repaint();
            serviceRepaints();
            try {
                Thread.sleep(500);
            }
            catch(Exception e) {

            }
        }
    }

    public void paint(Graphics g) {
        try {
            System.out.println("painting");
            g.setClip(0, 0, 240, 320);
            g.setColor(0);
            g.fillRect(0, 0, 240, 320);
            g.setColor(0xFF00FF);
            g.drawString("Hola", 0, 0, 0);
            g.drawString(Utils.getString(MENU.MENU_SOUND), 0, 20, 0);
            g.drawString(Utils.getString(MENU.MENU_YES), 0, 40, 0);
            g.drawString(Utils.getString(MENU.MENU_NO), 0, 60, 0);
            g.drawString(Utils.getString(MENU.MENU_EXIT), 0, 80, 0);
        }
        catch(Exception e) {
            System.out.println("Exc: paint: " + e.getMessage());
        }
    }

    public void load() {
        try {
            Utils.loadText(TEXTS_ES.resName);
        }
        catch(Exception e) {
            System.out.println("Exc: load: " + e.getMessage());
        }
    }
}
